import Vue from 'vue'
import VueRouter from 'vue-router'
import MLogin from '../components/mobile/mLogin'
import Register from '../components/regisetr'
import Home from '../components/Home'
import Welcome from '../components/Welcome'
import User from '../components/user/User'
import Rights from '../components/power/Rights'
import Roles from '../components/power/Roles'
import ShowData from '../components/data/ShowData'
import Regions from '../components/power/region'
import Application from '../components/user/application'
import GoodsManage from '../components/goods/goodsmanage'
import Category from '../components/power/category'
import Customer from '../components/customer/customer'
import Test from '../components/Test'
import goodscategory from '../components/goods/goods_category'
import Add from '../components/goods/Add'
import Test1 from '../components/data/test1'
import Login from '../components/login'
import MRegister from '../components/mobile/mRegister'
import GDisplay from '../components/mobile/gDisplay'
import ShopCart from '../components/mobile/shopCart'
import mHome from '../components/mobile/mHome'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/mlogin',
    component: MLogin
  }, {
    path: '/mRegister',
    component: MRegister
  }, {
    path: '/shopcart',
    component: ShopCart
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/register',
    component: Register
  },
  {
    path: '/mhome',
    component: mHome,
    redirect: '/gDisplay',
    children: [{
      path: '/gDisplay',
      component: GDisplay
    }]
  },
  {
    path: '/home',
    component: Home,
    redirect: '/welcome',
    children: [{
      path: '/welcome',
      component: Welcome
    }, {
      path: '/userlist',
      component: User
    }, {
      path: '/rolelist',
      component: Rights
    }, {
      path: '/roles',
      component: Roles
    }, {
      path: '/showdata',
      component: ShowData
    }, {
      path: '/region',
      component: Regions
    }, {
      path: '/application',
      component: Application
    }, {
      path: '/goodsmanage',
      component: GoodsManage
    }, {
      path: '/goodsmanageadd',
      component: Add
    }, {
      path: '/Category',
      component: Category
    }, {
      path: '/customer',
      component: Customer
    }, {
      path: '/test',
      component: Test
    }, {
      path: '/goods_category',
      component: goodscategory
    }, {
      path: '/test1',
      component: Test1
    }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
